home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / cbm / 2179 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.0 KB

  1. Path: merle.acns.nwu.edu!judd
  2. From: judd@merle.acns.nwu.edu (Stephen Judd)
  3. Newsgroups: comp.sys.cbm
  4. Subject: Re: Commodore Arithmetic
  5. Date: 9 Feb 1996 06:15:39 GMT
  6. Organization: Northwestern University, Evanston IL
  7. Message-ID: <4feoqb$b1c@news.acns.nwu.edu>
  8. References: <96020719151143766@qcs.org>
  9. Reply-To: sjudd@nwu.edu (Stephen Judd)
  10. NNTP-Posting-Host: merle.acns.nwu.edu
  11.  
  12. In article <96020719151143766@qcs.org>, Alan Jones  <alan.jones@qcs.org> wrote:
  13. >If you do accounting type stuff with dollars and cents, using binary FP
  14. >with its limited precision and rounding can be anoying.  If your
  15. >results are off one penny, all of your work will be suspect.  Our 6502
  16. >family of CPUs also has decimal arithmetic.  It can do decimal
  17. >arithmetic exactly, although you may have to program it yourself.  I
  18. >think the Paperclip word Processor will do simple calculations with up
  19. >to 40 decimal digits of precision.
  20.  
  21. Note that you can just as easily use integers for the calculations, and
  22. just divide by 100 before printing the result (e.g. in the case of dollars
  23. and cents).  I think BCD is a waste, and completely useless to boot. :)
  24.  
  25. By the way, I believe many of the old business machines (e.g. Burroughs)
  26. used BCD extensively (not to mention octal, e.g. a 6- or 9- bit byte :).
  27.  
  28. >This is not intended to be a Commodore FP tutorial.  It is reminder
  29. >that the C64/128 can be used for "heavy math", and there are no bugs
  30. >in the Commodore +, -, *, /, Floating Point arithmetic routines.  It
  31. >uses 32 binary bit mantisa FP reals with proper rounding.
  32. >Simple examples can always be contrived to demonstrate a perceived FP
  33. >bug by computer illiterates(?).
  34.  
  35. Just for fun, here is some "Heavy Math" that you can use your C64 for:
  36.  
  37.     x_n+1 = r * x_n * (1-x_n)
  38.  
  39. Try iterating that function for 0<=x<=1 for various values of r between
  40. one and four (1<r<4), and see what happens ;).  That is, fix r at some
  41. number between one and four.  Then pick a starting point x_0 somewhere
  42. between zero and one.  Then iterate the function, and see where x_n
  43. goes.
  44.  
  45.     evetS-
  46.  
  47. >alan.jones@qcs.org
  48.